Skip to content

Fix server startup failure when client-ca is empty or not provided#3742

Merged
openshift-merge-bot[bot] merged 1 commit intooperator-framework:masterfrom
jianzhangbjz:ca
Jan 21, 2026
Merged

Fix server startup failure when client-ca is empty or not provided#3742
openshift-merge-bot[bot] merged 1 commit intooperator-framework:masterfrom
jianzhangbjz:ca

Conversation

@jianzhangbjz
Copy link
Copy Markdown
Contributor

@jianzhangbjz jianzhangbjz commented Jan 21, 2026

Description of the change:
This PR fixes a bug in the pkg/lib/server package where the server fails to start when TLS is enabled but the --client-ca flag is empty or not provided.

Motivation for the change:
When --client-ca is empty or nil, filemonitor.NewCertPoolStore() attempts to call os.ReadFile("") which fails with an error, causing the server to crash on startup.

This issue was discovered during code review of PR #1190 (OPRUN-4416: Remove kube-rbac-proxy from PSM), which would be affected by this bug when PSM is started without a client CA configuration.

Architectural changes:

  1. Added clientCAEnabled() helper method to check if client CA path is provided and non-empty
  2. Modified getListenAndServeFunc() to conditionally setup client CA monitoring only when a valid path is provided
  3. Updated TLS configuration to only set ClientCAs and ClientAuth when client CA is available
  4. Added certPoolGetter interface for type-safe handling of the cert pool store

Testing remarks:

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Bug fixes are accompanied by regression test(s)
  • e2e tests and flake fixes are accompanied evidence of flake testing, e.g. executing the test 100(0) times
  • tech debt/todo is accompanied by issue link(s) in comments in the surrounding code
  • Tests are comprehensible, e.g. Ginkgo DSL is being used appropriately
  • Docs updated or added to /doc
  • Commit messages sensible and descriptive
  • Tests marked as [FLAKE] are truly flaky and have an issue
  • Code is properly formatted

Assisted-By: Claude-Code

@tmshort
Copy link
Copy Markdown
Contributor

tmshort commented Jan 21, 2026

/approve

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 21, 2026
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jan 21, 2026
Copy link
Copy Markdown
Member

@rashmigottipati rashmigottipati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jan 21, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: grokspawn, rashmigottipati, tmshort

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot Bot merged commit 01449fd into operator-framework:master Jan 21, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants